import React, { Component } from 'react'
import {
  SafeAreaView, // 适配有刘海的屏幕
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
  Button,
  Alert,
  Switch,
  ActivityIndicator,
  Platform,
  Image,
  Dimensions,
} from 'react-native'

export default function index() {

  return (
    <SafeAreaView style={[styles.container]}>
      <ScrollView
        style={[{ backgroundColor: '#fff' }]}
        horizontal={true}
        showsVerticalScrollIndicator={false} // 是否隐藏滚动条
      >
        <Text style={[styles.channel]}>新闻</Text>
        <Text style={[styles.channel]}>娱乐</Text>
        <Text style={[styles.channel]}>体育</Text>
        <Text style={[styles.channel]}>财经</Text>
        <Text style={[styles.channel]}>军事</Text>
        <Text style={[styles.channel]}>时尚</Text>
        <Text style={[styles.channel]}>科技</Text>
        <Text style={[styles.channel]}>美食</Text>
      </ScrollView>

      <ScrollView
        style={[styles.scrollview]}
        contentContainerStyle={{ padding: 20 }}
        showsVerticalScrollIndicator={true} // 是否隐藏滚动条
      >
        <Text style={[styles.text]}>
          {`A very old song tells us that "you are my sunshine".
          有一首老歌告诉我们,"你是我的阳光"。
          
          It’s all right to believe that someone brings sunshine into your life. That someone
          might have enough to spread1 round. But, if you really have to wait for someone else to be your sunshine, your good feelings, then you might wait for a long time.
          相信会有一个人把阳光带进你的生活中是可以的。那个人也许会有足够的东西去四处传播。但是,如
          果你真的要等别人带给你阳光,带给你美好的感受,那你也许要等上很长的时间。
          
          Now is the time to be of good cheer, this very moment. Don’t wait for anyone else to
          determine your mood. You have completely control4 of your own disposition5. You have the choice. There is no other way.
          现在是时候欢呼了,就在这一刻。不要等待别人来左右你的情绪。你可以完全控制你的性情。你有这
          个选择。没有其他别的办法。
          
          Your present moment of good cheer will carry you to the next, and you will be in
          control of that moment also. You are worth6 having good. Go for it!
          你这一刻的欢呼会带你走到下一刻,你也将会把握住那一刻。你值得拥有美好的事物。去争取吧!`}
        </Text>
      </ScrollView>
    </SafeAreaView>
  )
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff'
  },
  channel: {
    padding: 10,
    fontSize: 20,
  },
  scrollview: {
    backgroundColor: '#efefef',
  },
  text: {
    fontSize: 20,
  }
})
